using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;
using UnityEngine;

public class UserEmployerDataTool : BaseDataTool<UserEmployerDAO>
{

    public UserEmployerDAO FindEmployerById(int id)
    {
        return data?.Find(e => e.id == id);
    }

    public List<UserEmployerDAO> FindEmployersById(int id)
    {
        return data?.FindAll(e => e.id == id);
    }

    protected override List<UserEmployerDAO> ParseData(string jsonData)
    {
        var wrapper = JsonConvert.DeserializeObject < UserEmployerWrapper >(jsonData);
        return wrapper.UserEmployers ?? new List<UserEmployerDAO>();
    }
}

public class UserEmployerWrapper
{
    public List<UserEmployerDAO> UserEmployers { get; set; }
}

public class UserEmployerDAO
{
    public int id { set; get; }
    public int hire_state { set; get; }
    public int dispatch_num { set; get; } // 派遣的建筑物数字
    public string employ_name { set; get; }
    public int employ_level { set; get; }
    public int community_id { set; get; }
    public int employ_rating { set; get; }
    public string special_type { set; get; }
    public string icon { set; get; }
    public string slogan { set; get; }
    public List<string> types { set; get; }
    public int lvup_money { set; get; }
    public int lvup_exp { set; get; }
    public int eid { set; get; }
    public int pve_formation_id { set; get; }
    public int e_star { set; get; }
    public int level_limit_by_ad { set; get; }
}